/*
 * Log.java
 *
 * Created on 19 de junio de 2006, 10:47 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package inc.jmc.cyberboard.log;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

/**
 *
 * @author Juan Miguel Olguin Salguero
 */
public class Log {
    
    static java.util.Properties loggFiles=new java.util.Properties ();
    static{
        //Appender app = new Appender();
        //BasicConfigurator.configure();
        
	try{
            System.out.println("Inicializacion de log4j");
            loggFiles.load(inc.jmc.cyberboard.log.Log.class.getResourceAsStream("ccn_logger.properties"));
            PropertyConfigurator.configure(loggFiles);
            System.out.println("Inicializacion de log4j OK");
            
	}
	catch(java.io.IOException ex)
	{
              ex.printStackTrace();
	}
        
    
    }
    private static Logger logger = Logger.getLogger(Log.class);
    /** Creates a new instance of Log */
    private static boolean logs=true;
    public void setLog(boolean apply)
    {
        logs=apply;
    }
    private Log() {
    }
    public static void log(String mensaje)
    {
        if(logs)
        {
            logger.info(mensaje);
        }
       
    }
    public static void log(Object mensaje)
    {
        log(mensaje.toString());
    }
    
}
